{{Extend "layout"}}
{{Block "title"}}{{"修改密码"|$.T}}{{/Block}}
{{Block "breadcrumb"}}
{{Super}}
<li class="active">{{"修改密码"|$.T}}</li>
{{/Block}}

{{Block "bodyNav"}}
{{Include "user/body_nav"}}
{{/Block}}

{{Block "head"}}
{{/Block}}
{{Block "main"}}

<div class="row">
    <div class="col-md-12">
        <div class="block-flat no-padding">
          <div class="header">							
            <h3>{{"修改密码"|$.T}}</h3>
          </div>
          <div class="content">
              <form class="form-horizontal group-border-dashed" data-parsley-validate novalidate method="POST" id="password-form" data-secret="{{SM2PublicKey}}:{{call $.Func.EnvKey}}" action="{{BackendURL}}/user/password">
              <div class="form-group">
                <label class="col-sm-2 control-label">{{"新密码"|$.T}}</label>
                <div class="col-sm-8">
                    <input type="password" id="newPass" data-parsley-trigger="change" required class="form-control" name="newPass" value="{{$.Form "newPass"}}">
                </div>
              </div>
              <div class="form-group">
                <label class="col-sm-2 control-label">{{"确认新密码"|$.T}}</label>
                <div class="col-sm-8">
                    <input type="password" data-parsley-equalto="#newPass" required data-parsley-trigger="change" class="form-control" name="confirmPass" value="{{$.Form "confirmPass"}}">
                </div>
              </div>
              <div class="form-group">
                <label class="col-sm-2 control-label">{{"密码验证"|$.T}}</label>
                <div class="col-sm-8">
                    <input type="password" data-parsley-trigger="change" required class="form-control" name="pass" value="{{$.Form "pass"}}" placeholder="{{"旧密码"|$.T}}">
                </div>
              </div>
              {{if $.Stored.needCheckU2F}}
              <div class="form-group">
                <label class="col-sm-2 control-label">{{"两步验证"|$.T}}</label>
                <div class="col-sm-8">
                    <input type="password" data-parsley-trigger="change" required class="form-control" name="u2fCode" value="{{$.Form "u2fCode"}}" placeholder="{{"输入两步验证设备上显示的密码"|$.T}}">
                    <div class="help-block">{{"输入两步验证设备上显示的密码"|$.T}}</div>
                </div>
              </div>
              {{end}}
              <div class="form-group form-submit-group">
				<div class="col-sm-9 col-sm-offset-2">
                    <input type="hidden" name="modifyPass" value="1">
					<button type="submit" class="btn btn-primary btn-lg"><i class="fa fa-save"></i> {{"保存"|$.T}}</button>
					<button type="reset" class="btn btn-default btn-lg"><i class="fa fa-refresh"></i> {{"重置"|$.T}}</button>
				</div>
			  </div>
            </form>
          </div><!-- /.content -->
        </div><!-- /.block-flat -->
    </div>
</div>
{{/Block}}
{{Block "footer"}}
<script type="text/javascript" src="{{AssetsURL}}/js/crypto/crypto-js.min.js?t={{BuildTime}}"></script>
<script type="text/javascript" src="{{AssetsURL}}/js/crypto/sm2.min.js?t={{BuildTime}}"></script>
<script type="text/javascript" src="{{AssetsURL}}/js/crypto/helper.min.js?t={{BuildTime}}"></script>
<script type="text/javascript">
$(function(){
  submitEncryptedData('#password-form');
});
</script>
{{/Block}}